package com.yvon.maple.auth.authorization.exception;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;

import java.io.IOException;

/**
 * @author: Yvon
 * @Date: 2020/6/13 19:03
 * @Description:
 */
public class CustomOAuthExceptionJacksonSerializer extends StdSerializer<CustomOAuth2Exception> {

    protected CustomOAuthExceptionJacksonSerializer() {
        super(CustomOAuth2Exception.class);
    }

    @Override
    public void serialize(CustomOAuth2Exception value, JsonGenerator gen, SerializerProvider serializerProvider) throws IOException {
        gen.writeObject(value.getResponseData());
    }
}
